// 科目管理
import { ContentTypeEnum } from '/@/enums/httpEnum';
import { defHttp } from '/@/utils/http/axios'
import { request } from '/@/utils/http/axios';
// 获取首页评阅详情列表
export const getSubjectList = (params) => {
  return request({
    url: `/basic/findKmxxVOList?pageSize=${params.pageSize || 0}&pageNum=${params.pageNum || 1}`,
    method: 'post',
    params,
  });
};

// 获取首页评阅详情列表
export const getKmSimpAlleList = (params) => {
  return request({
    url: `/basic/getKmSimpleList?pageSize=${params.pageSize || 0}&pageNum=${params.pageNum || 1}`,
    method: 'GET',
    params,
  });
};



// 查询分数列表
export const getQueryScore = (params) => {
  return request({
    url: '/py/queryScore',
    method: 'GET',
    headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
    params,
  });
};

// 删除学院
export const deleteSubjectById = (params) => {
  return request({
    url: '/kmxx/deleteByIds',
    method: 'DELETE',
    params,
  });
};

// 新建 编辑
export const saveOrUpdateSubject = (params) => {
  return request({
    url: '/kmxx/saveOrUpdateByDTO',
    method: 'POST',
    params,
  });
};

// 批量设置评阅相关设置
export const saveOrUpdateAllSubject = (params) => {
  return request({
    url: '/kmxx/batchUpdatePyAboutConfig',
    method: 'POST',
    params,
  });
};


// 分配教师
export const allotTeacher = (params) => {
  return request({
    url: '/basic/distributePyjsForKmdm',
    method: 'POST',
    params,
  });
};



// 获取已分配的教师
export const getHasTeachee = (params) => {
  return request({
    url: '/basic/getDistributePyjsForKmdm',
    method: 'GET',
    params,
  });
}

// 分配教师
export const allotLeaderTeacher = (params) => {
  return request({
    url: '/basic/distributePyzzAccount',
    method: 'POST',
    params,
    // headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
  });
};

// 组长取消绑定
export const saveCancelPyzzAccount = (params) => {
  return request({
    url: '/basic/cancelPyzzAccount',
    method: 'POST',
    params,
  });
};






// 获取操作日志列表
export const getOperateLogFindVoList = (params) => {
  return request({
    url: `/log/queryOperateLog?pageNum=${params.pageNum || 1}&pageSize=${params.pageSize || 0}`,
    method: 'POST',
    params,
  });
};

// 获取操作日志列表
export const getQueryLoginAndOutAccessLog = (params) => {
  return request({
    url: `/log/queryLoginAndOutAccessLog?pageNum=${params.pageNum || 1}&pageSize=${params.pageSize || 0}`,
    method: 'POST',
    params,
  });
};

// 获取操作日志列表
export const getQueryPySubmitLog = (params) => {
  return request({
    url: `/log/queryPySubmitLog?pageNum=${params.pageNum || 1}&pageSize=${params.pageSize || 0}`,
    method: 'POST',
    params,
  });
};


// 获取操作日志类型
export const getOperateLogTitleList = (params = {}) => {
  return request({
    url: `/log/getOperateLogTitleList`,
    method: 'GET',
    params,
  });
};

// 科目管理归档
export const autoHandleJdByKmdmAndYear = (params) => {
  return request({
    url: `/coreWork/computeKsZdf4Save`,
    method: 'get',
    params,
  });
};

// 科目管理成绩导出
export const HandleJdByCjInfo = (params) => {
  // return request({
  //   url: `/importExport/exportKsCjInfo`,
  //   method: 'get',
  //   params,
  // });
  return defHttp.get<any>(
    {
      url: '/importExport/exportKsCjInfo',
      params,
      responseType: 'blob',
      timeout: 1800 * 1000
    },
    {
      isTransformResponse: false,
    }
  )
};


// 科目评阅精度统计
export const getKmPyProcess = (params) => {
  return request({
    url: `/summary/summaryKmKsPyProcessSimpleBatch`,
    method: 'POST',
    params,
  });
};
